-
-
Notifications
You must be signed in to change notification settings - Fork 423
Fix YAML scientific notation parsing as float #2913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughIntroduces YAML scientific notation pattern recognition and extends the CustomSafeLoader to properly resolve scientific notation values (e.g., Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)tests/main/test_main_yaml.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📚 Docs Preview: https://pr-2913.datamodel-code-generator.pages.dev |
CodSpeed Performance ReportMerging #2913 will degrade performance by 17.71%Comparing
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | test_perf_graphql_style_pydantic_v2 |
695.7 ms | 829.1 ms | -16.09% |
| ❌ | WallTime | test_perf_duplicate_names |
839.6 ms | 1,020.3 ms | -17.71% |
| ❌ | WallTime | test_perf_aws_style_openapi_pydantic_v2 |
1.6 s | 2 s | -15.53% |
| ❌ | WallTime | test_perf_openapi_large |
2.5 s | 2.9 s | -15.29% |
| ❌ | WallTime | test_perf_all_options_enabled |
5.7 s | 6.8 s | -15.21% |
| ❌ | WallTime | test_perf_kubernetes_style_pydantic_v2 |
2.2 s | 2.6 s | -15.95% |
| ❌ | WallTime | test_perf_stripe_style_pydantic_v2 |
1.7 s | 2 s | -15.63% |
| ❌ | WallTime | test_perf_multiple_files_input |
3.1 s | 3.8 s | -17.56% |
| ❌ | WallTime | test_perf_deep_nested |
5.1 s | 6.1 s | -15.71% |
| ❌ | WallTime | test_perf_large_models_pydantic_v2 |
3.1 s | 3.7 s | -16.98% |
| ❌ | WallTime | test_perf_complex_refs |
1.7 s | 2 s | -16.78% |
Footnotes
-
98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2913 +/- ##
==========================================
+ Coverage 99.38% 99.40% +0.02%
==========================================
Files 92 95 +3
Lines 16342 16910 +568
Branches 1934 1991 +57
==========================================
+ Hits 16241 16809 +568
Misses 52 52
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is a bug fix that corrects incorrect YAML parsing behavior. Previously, scientific notation without decimal points (e.g., 1e-5, 1E+10) was incorrectly parsed as strings instead of floats. The fix makes the YAML parser correctly recognize these as float values per YAML specification. While the generated code output will change for users who have YAML files with such scientific notation defaults, this change is from incorrect behavior to correct behavior - not a breaking change in the conventional sense. No API, CLI, templates, defaults, or Python version support were modified. This analysis was performed by Claude Code Action |
|
🎉 Released in 0.52.1 This PR is now available in the latest release. See the release notes for details. |
Fixes: #1955
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.